<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/jsp/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Dotnet2-web 后台管理系统</title>
<script>
function submit(){
	$("#form1").submit();
}
</script>
<%@ include file="/jsp/common/commonJs.jsp"%>
</head>
<body>
<!--header-->
<%@ include file="/jsp/top.jsp"%>
<!--header-->

<!--aside nav-->
<%@ include file="/jsp/left.jsp"%>
<!--aside nav  -->
<section class="rt_wrap content mCustomScrollbar" style="margin-top:10px;">
      <div class="page_title" style="padding-bottom: 10px">
      <form action="${path}/productinfo/selectAllInfo.do" method="post">
	      产品名称：<input type="text" name="searchName" class="textbox textbox_225" placeholder="请输入产品名" value="${searchName}" />
	      <span>
		       产品分类：<select class="select" name="searchType">
					<option value="">请选择</option> 
		       		<option value="1" <c:if test="${searchType==1}">selected</c:if> >基本产品</option>
		       		<option value="2" <c:if test="${searchType==2}">selected</c:if> >高级产品</option>
		      		<option value="3" <c:if test="${searchType==3}">selected</c:if> >定制产品</option>
		      </select>
		    所属城市:<select class="select" name="searchCity">
		    	<c:forEach items="${list}" var="city">
		    		<option value="${city.cityName}" <c:if test="${searchCity==city.cityName}">selected</c:if>>${city.cityName}</option>
		    	</c:forEach>
		    </select>
	      <input type="button" value="搜索" class="group_btn" onclick="submit()" />
	      </span>
      </form>
      	<a class="fr top_rt_btn" style="margin-top: 20px" href="${path}/productinfo/toaddProductInfo.do">添加产品</a>
      </div>
      <table class="table" style="margin-top: 70px">
		<thead style="margin-top: 50px">
			<tr>
				<td style="display: none">ID</td>
				<th>产品名称</th>
				<th>产品分类</th>
				<th>是否启用</th>
				<th>是否删除</th>
				<th>是否页面显示</th>
				<th>是否产品中心显示</th>
				<th>所属城市</th>
				<th>创建时间</th>
				<th>操作</th>
			</tr>
		</thead>
		<c:forEach items="${page.list}" var="productinfo">
			<tr align="center">
				<td style="display: none">${productinfo.id}</td>
				<td >${productinfo.productName}</td>
				<td >${productinfo.productType==1?"基本产品":productinfo.productType==2?"高级产品":"定制产品"}</td>
				<td >${productinfo.isUse==0?"<font color=red>否</font>":"<font color=green>是</font>"}</td>
				<td >${productinfo.isDelete==0?"<font color=red>否</font>":"<font color=green>是</font>"}</td>
				<td >${productinfo.isUseIndex==0?"<font color=red>否</font>":"<font color=green>是</font>"}</td>
				<td >${productinfo.isUseCenter==0?"<font color=red>否</font>":"<font color=green>是</font>"}</td>
				<td >${productinfo.cityName}</td>
				<td ><fmt:formatDate value="${productinfo.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
       			<td>
       			<a class="btn btn-info" href="${path}/productinfo/productDetail.do?id=${productinfo.id}">产品详情</a>
       			<a class="btn btn-info" href="${path}/productinfo/forwardProductInfo.do?id=${productinfo.id}">产品更新</a>
       			<!-- 是否启用判断 -->
       				<a class="btn btn-warning" href="${path}/productinfo/upProductInfo.do?id=${productinfo.id}&isUse=${productinfo.isUse}">
       					<c:if test="${productinfo.isUse==0}">启用</c:if>
       					<c:if test="${productinfo.isUse==1}">停用</c:if>
       				</a>
       			<!-- 是否删除判断 -->
       				<a class="btn btn-warning" href="${path}/productinfo/updelete.do?id=${productinfo.id}&isDelete=${productinfo.isDelete}">
       					<c:if test="${productinfo.isDelete==0}">删除</c:if>
       					<c:if test="${productinfo.isDelete==1}">恢复</c:if>
       				</a>
       			<!-- 是否页面显示判断 -->
       				<a class="btn btn-warning" href="${path}/productinfo/upIndex.do?id=${productinfo.id}&isUseIndex=${productinfo.isUseIndex}">
       					<c:if test="${productinfo.isUseIndex==0}">页面显示</c:if>
       					<c:if test="${productinfo.isUseIndex==1}">取消页面显示</c:if>
       				</a>
       			<!-- 是否产品中心显示判断 -->
       				<a class="btn btn-warning" href="${path}/productinfo/upCenter.do?id=${productinfo.id}&isUseCenter=${productinfo.isUseCenter}">
       					<c:if test="${productinfo.isUseCenter==0}">产品中心显示</c:if>
       					<c:if test="${productinfo.isUseCenter==1}">取消中心显示</c:if>
       				</a>
       			</td>
			</tr>
		</c:forEach>								
	</table>		
	 <aside class="paging">
	 	<c:forEach items="${page.pageView}" var="page">
	 		${page }
	 	</c:forEach>
	 </aside>
</section>
</body>
</html>
